package org.springframework.android.showcase.location;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;

import com.baidu.mapapi.GeoPoint;
import com.baidu.mapapi.MapView;
import com.baidu.mapapi.Overlay;

public class MyOverlay extends Overlay{

    GeoPoint geoPoint = new GeoPoint((int) (31.270 * 1E6), (int) (120.730 * 1E6));
    Paint paint = new Paint();
    
    
    @Override
    public void draw(Canvas canvas, MapView mapView, boolean shadow) {
        //在天安门的位置绘制一个String
        Point point = mapView.getProjection().toPixels(geoPoint, null);
        canvas.drawText("★这里是天安门", point.x, point.y, paint);
    }
}
